import request from '@/utils/http';

/** 账号密码登录 */
export const login = (data: object) => {
  // return request.post('/mock/api/login', data);
  return request.post('/login/passwdLogin', data);
};
/** 手机号登录 */
export const phoneLogin = (data: object) => {
  return request.post('/login/smsLogin', data);
};
/** 获取图片验证 */
export const getImgCode = (data: object) => {
  return request.post('/captcha/imgCode', data, { responseType: 'blob' });
};
/** 发送短信验证码 */
export const getSmsCode = (data: object) => {
  return request.post('/login/smsCode', data);
};

export const getUserInfo = () => {
  return request.get('/mock/api/userInfo');
};

/** 获取tree菜单列表 */
export const getMenuList = (data: any): Promise<App.RequestResult> => {
  // return request.get('/mock/api/menuList');
  return request.post('/perm/getPerm', data);
};
/** 退出登录 */
export const loginLogoutRequest = (data:any) => {
  return request.post('/login/logout',data);
};
